import java.util.function.Function;
import java.util.function.UnaryOperator;

class User2{
    private String username;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String say(UnaryOperator<String> sayHello){
        return sayHello.apply(this.username);
    }
}

public class LambdaDemo03 {
    public static void main(String[] args) {
        User user = new User();
        user.setUsername("zhang3");
        //Function<String,String> func = (username) -> "hello" + username;
        UnaryOperator<String> func = (username) -> "hello" +username;
        String say = user.say(func.andThen(s-> s + "opp"));
        System.out.println("say=" + say);
    }
}
